import Vue from 'vue'
import Vuex from 'vuex'
//import * as actions from './actions'
//import * as getters from './getters'
//import cart from './modules/cart'

Vue.use(Vuex)

const state = {
	baseCondition:'',//排序条件
	
	productName:'', //搜索课程名称
	one_level:'', //一级类别
	two_level:'',//二级类别
	three_level:'',//三级类别
	
};

const mutation = {
	reset(){
		console.log('saaaa')
	}
};
const actions = {};
//计算属性
const getters = {
    categoryId :function(state){ //类型ID
    	if(state.three_level){
			return state.three_level;
		}else if(state.two_level){
			return state.two_level
		}else {
			return state.one_level
		}
        return state.one_level;
    }
}

const store = new Vuex.Store({
	state,
	actions,
	mutation,
	getters
});
export default store